import unittest
from test_cases import test_demo1, test_demo2


# 创建一个加载器对象 ,加载测试类
loader = unittest.TestLoader()

# 加载参数是测试类
loader1 = loader.loadTestsFromTestCase(test_demo1.Demo1TestCase)
loader2 = loader.loadTestsFromTestCase(test_demo2.Demo2TestCase)

# 创建测试套件, 收集测试类
suite = unittest.TestSuite()
suite.addTests([loader1, loader2])

# 创建执行器, 执行测试类
runner = unittest.TextTestRunner(verbosity=2)
runner.run(suite)

